﻿using Microsoft.Extensions.DependencyInjection;
using RivetProject.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RivetProject
{
    public class ServiceLocator
    {
        private IServiceProvider serviceProvider;

        public MainWindowViewModel? MainWindowViewModel => serviceProvider.GetService<MainWindowViewModel>();


        public ServiceLocator()
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton<MainWindowViewModel>();
            
            serviceProvider = serviceCollection.BuildServiceProvider();
        }
    }
}
